<template>
	<view class="profile">
		<!-- 个人信息 -->
		<view class="profile_info">
			<view class="info_img">
				<image :src="Avatar" mode=""></image>
			</view>
			<view class="info_con">
				<view>{{userInfo.nickname}}<text></text></view>
				<view style="font-size: 16rpx;">{{userInfo.mobile||'手机号未绑定'}}</view>
			</view>
			<view class="iconfont icon-arrows_right" ></view>
		</view>
		<view class="warpbox">
			<view class="warptitle">功能</view>
			<view class="fun_box">
				<view class="fun_fir" @click="toSetting">
					<!-- <view class="message_num" :class="item.is_show? 'color':'colore'">{{info.leads.count}}</view> -->
					<image src="@/static/icon/setting.png"></image>
					<view>系统设置</view>
				</view>
			</view>
		</view>
		<view class="profile_fun">
		
			<view class="profile_item" @click="toEnterprise(userInfo.id)">
				<view class="iconfont"><image src="@/static/icon/company.png" mode=""></image></view>
				<view class="lxs_font">企业信息</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
			<button class="profile_item" open-type="contact">
				<view class="iconfont"><image src="@/static/icon/serve.png"  mode=""></image></view>
				<view class="lxs_font">问题反馈</view>
				<view class="iconfont icon-arrows_right"></view>
			</button>
			<view class="profile_item" @click="toAboutApp">
				<view class="iconfont"><image src="@/static/icon/about.png" mode=""></image></view>
				<view class="lxs_font">关于App</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
			<view class="profile_item" @click="logout">
				<view class="iconfont"><image src="@/static/icon/loginout.png" mode=""></image></view>
				<view class="lxs_font">注销登录</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
		</view>
		
	</view>
</template>
	 
<script>
import { userInfo } from 'os'
	
	export default {
		mixins:[],
		components:{
			
		},
		data() {
			return {
				userInfo:{
					avatar:""
				},
				roleType:1,
				rules:[],
				tipNumber:null,
			}
		},
		onShow() {
			this.getInfo()
		},
		computed:{
			Avatar(){
				return "http://1.116.9.185" + this.userInfo.avatar.replace("http://1.116.9.185","")
			}
		},
		methods: {
			logout(){
				this.$api.user.logout().then(res=>{
					uni.removeStorageSync("userInfo")
					uni.showToast({
						title:'退出登录成功！',
						icon:'none'
					})
					setTimeout(()=>{
						uni.redirectTo({
							url:'/pages/user/login'
						})
					},1500)
					console.log(res)
				}).catch(err=>{
					uni.showToast({
						title:err.data.msg,
						icon:'none'
					})
					console.log(err)
				})
			},
			getInfo() {
				this.userInfo = uni.getStorageSync('userInfo')
				this.$api.user.info().then(res=>{
					console.log(res)
				}).catch(err=>{
					uni.showToast({
						title:err.data.msg,
						icon:'none'
					})
					console.log(err)
				})
			},
			toSetting(){
				uni.showToast({
					title:"暂无页面"
				})
			},
			// 个人资料
			setPeopleDataClick() {
				uni.navigateTo({
					url:'/pages/profile/mySet/setPersonData/setPersonData'
				})
			},
			//员工列表 
			jumpStaffList() {
				uni.navigateTo({
					url:'/pages/profile/staff/stafflist/index'
				})
			},
			//审核  员工  列表
			jumpExamineStaff() {
				uni.navigateTo({
					url:'/pages/profile/staff/examinestaff/index'
				})
			},
			// 企业信息
			toEnterprise(id) {
				console.log(id,'id')
				uni.navigateTo({
					url: '/pages/profile/enterpriseInfo/enterpriseInfo?id?' +id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.message_num {
		width: 20rpx;
		height: 20rpx;
		// line-height: 10rpx;
		border-radius: 20rpx;
		// background-color: #f95e5a;
		color: #fff;
		// float: right;
		position: relative;
		top: 0;
		right: 0;
	}
	.color{
		background: #fff;
	}
	.colore{
		background: #f00;
	}
	.warpbox{
		width:702rpx;
		box-sizing: border-box;
		background:#fff;
		border-radius: 20rpx;
		margin:0 auto 30rpx;
		padding:30rpx;
		box-shadow: 1rpx 1rpx 10rpx rgba(0,0,0,0.1);
		.warptitle{
			font-size:26rpx;
			color:#333;
			margin-bottom:30rpx;
		}
		.fun_box{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			flex-wrap:wrap;
			.fun_fir{
				flex-shrink: 0;
				background:#fff;
				border-radius: 10rpx;
				text-align: center;
				width:142rpx;
				height:115rpx;
				margin-right:24rpx;
				margin-bottom:24rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				font-size:24rpx;
				color:#000;
				&:nth-child(4n){
					margin-right:0;
				}
				image{
					width:50rpx;
					height:50rpx;
					margin-bottom:15rpx;
				}
			}
		}
	}
.profile {
	// 个人信息
	.profile_info {
		background-color: #fff;
		display: flex;
		padding: 50rpx 20rpx 50rpx 60rpx;
		border-bottom: 1rpx solid #EAEAEA;
		margin-bottom: 30rpx;
		.info_img {
			width: 150rpx;
			image {
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
			}
		}
		.info_con {
			flex: 1;
			margin-top: 20rpx;
			:first-child {
				font-size: 28rpx;
				margin-bottom: 15rpx;
			}
			text {
				font-size: 24rpx;
				margin-left: 10rpx;
				color: #999;
			}
			:last-child {
				color: #999;
			}
		}
		.icon-arrows_right {
			width: 40rpx;
			margin-top: 47rpx;
			font-size: 40rpx;
		}
	}
	// 功能模块
	.profile_fun {
		background-color: #fff;
		.profile_item {
			display: flex;
			background:#fff;
			color:#666;
			padding: 0 30rpx;
			justify-content: space-between;
			border-bottom:1rpx solid #f5f5f5;
			height: 110rpx;
			line-height: 110rpx;
			font-size: 28rpx;
			:nth-child(2) {
				margin-left: -468rpx;
			}
			.iconfont image{
				height:25px;
				width:25px;
			}
		}
		button::after{
			border:none;
		}
	}
}

.iconfont{
	display: flex;
	align-items: center;
}
.lxs_font{
	font-size: 14px;
}
</style>
